Is that possible with DXL to do something like this code : Object o // o has a real attribute named "X" ... // some code to set o real x = 1. #define DOIT(X) \ o . #X = X DOIT(x)
Object o // o has a real attribute named "X" ... // some code to set o real x = 1. o."x" = x
SystemAdmin - Tue Feb 15 12:14:37 EST 2011 |
Re: Is there something similar to C #define for its stringizer ? o had an attribute named "x" (in lower, not upper, case. Sorry for the confusion.
|
Re: Is there something similar to C #define for its stringizer ? However you can do a preprocessor DXL++ which will enable all those nifty syntax features, and then we can see if we get sodius to integrate it in the DXL editor ;-) I offer classes and inheritance as features for DXL++. Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Is there something similar to C #define for its stringizer ? Mathias Mamsch - Tue Feb 15 12:44:42 EST 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS Well, rather than re-inventing the wheel there could some use of some existing multipurpose preprocessor like M4. There could be some kind of script detecting if there are some file foo.m4 and no file foo.dxl, or file foo.dxl is older than foo.m4, then run m4 on foo.m4, and if this works then run foo.dxl. That would not be C like, but on the other hand m4 is by far more powerful than the C preprocessor is, and I guess that the developping effort would be quite light as m4 is a free software that existing on most platforms --- as it is par of the GNU project. Vincent. |
Re: Is there something similar to C #define for its stringizer ? SystemAdmin - Wed Feb 16 02:50:16 EST 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Is there something similar to C #define for its stringizer ?
Could you please clarify what is awkward in M4 syntax, and what other alternative you consider.
cpp --help
Usage: cpp.exe [options] file...
Options:
-pass-exit-codes Exit with highest error code from a phase
--help Display this information
--target-help Display target specific command line options
--help={target|optimizers|warnings|undocumented|params}[,{[^]joined|[^]separate}]
Display specific types of command line options
(Use '-v --help' to display command line options of sub-processes)
-dumpspecs Display all of the built in spec strings
-dumpversion Display the version of the compiler
-dumpmachine Display the compiler's target processor
-print-search-dirs Display the directories in the compiler's search path
-print-libgcc-file-name Display the name of the compiler's companion library
-print-file-name=<lib> Display the full path to library <lib>
-print-prog-name=<prog> Display the full path to compiler component <prog>
-print-multi-directory Display the root directory for versions of libgcc
-print-multi-lib Display the mapping between command line options and
multiple library search directories
-print-multi-os-directory Display the relative path to OS libraries
-print-sysroot-headers-suffix Display the sysroot suffix used to find headers
-Wa,<options> Pass comma-separated <options> on to the assembler
-Wp,<options> Pass comma-separated <options> on to the preprocessor
-Wl,<options> Pass comma-separated <options> on to the linker
-Xassembler <arg> Pass <arg> on to the assembler
-Xpreprocessor <arg> Pass <arg> on to the preprocessor
-Xlinker <arg> Pass <arg> on to the linker
-combine Pass multiple source files to compiler at once
-save-temps Do not delete intermediate files
-pipe Use pipes rather than intermediate files
-time Time the execution of each subprocess
-specs=<file> Override built-in specs with the contents of <file>
-std=<standard> Assume that the input sources are for <standard>
--sysroot=<directory> Use <directory> as the root directory for headers
and libraries
-B <directory> Add <directory> to the compiler's search paths
-b <machine> Run gcc for target <machine>, if installed
-V <version> Run gcc version number <version>, if installed
-v Display the programs invoked by the compiler
-### Like -v but options quoted and commands not executed
-E Preprocess only; do not compile, assemble or link
-S Compile only; do not assemble or link
-c Compile and assemble, but do not link
-o <file> Place the output into <file>
-x <language> Specify the language of the following input files
Permissible languages include: c c++ assembler none
'none' means revert to the default behavior of
guessing the language based on the file's extension
Options starting with -g, -f, -m, -O, -W, or --param are automatically
passed on to the various sub-processes invoked by cpp.exe. In order to pass
other options on to these processes the -W<letter> options must be used.
For bug reporting instructions, please see:
<http://www.mingw.org/bugs.shtml>.
|
Re: Is there something similar to C #define for its stringizer ? SystemAdmin - Thu Feb 17 05:53:38 EST 2011
Could you please clarify what is awkward in M4 syntax, and what other alternative you consider.
cpp --help
Usage: cpp.exe [options] file...
Options:
-pass-exit-codes Exit with highest error code from a phase
--help Display this information
--target-help Display target specific command line options
--help={target|optimizers|warnings|undocumented|params}[,{[^]joined|[^]separate}]
Display specific types of command line options
(Use '-v --help' to display command line options of sub-processes)
-dumpspecs Display all of the built in spec strings
-dumpversion Display the version of the compiler
-dumpmachine Display the compiler's target processor
-print-search-dirs Display the directories in the compiler's search path
-print-libgcc-file-name Display the name of the compiler's companion library
-print-file-name=<lib> Display the full path to library <lib>
-print-prog-name=<prog> Display the full path to compiler component <prog>
-print-multi-directory Display the root directory for versions of libgcc
-print-multi-lib Display the mapping between command line options and
multiple library search directories
-print-multi-os-directory Display the relative path to OS libraries
-print-sysroot-headers-suffix Display the sysroot suffix used to find headers
-Wa,<options> Pass comma-separated <options> on to the assembler
-Wp,<options> Pass comma-separated <options> on to the preprocessor
-Wl,<options> Pass comma-separated <options> on to the linker
-Xassembler <arg> Pass <arg> on to the assembler
-Xpreprocessor <arg> Pass <arg> on to the preprocessor
-Xlinker <arg> Pass <arg> on to the linker
-combine Pass multiple source files to compiler at once
-save-temps Do not delete intermediate files
-pipe Use pipes rather than intermediate files
-time Time the execution of each subprocess
-specs=<file> Override built-in specs with the contents of <file>
-std=<standard> Assume that the input sources are for <standard>
--sysroot=<directory> Use <directory> as the root directory for headers
and libraries
-B <directory> Add <directory> to the compiler's search paths
-b <machine> Run gcc for target <machine>, if installed
-V <version> Run gcc version number <version>, if installed
-v Display the programs invoked by the compiler
-### Like -v but options quoted and commands not executed
-E Preprocess only; do not compile, assemble or link
-S Compile only; do not assemble or link
-c Compile and assemble, but do not link
-o <file> Place the output into <file>
-x <language> Specify the language of the following input files
Permissible languages include: c c++ assembler none
'none' means revert to the default behavior of
guessing the language based on the file's extension
Options starting with -g, -f, -m, -O, -W, or --param are automatically
passed on to the various sub-processes invoked by cpp.exe. In order to pass
other options on to these processes the -W<letter> options must be used.
For bug reporting instructions, please see:
<http://www.mingw.org/bugs.shtml>.
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |